<template>
    <VuePdfEmbed v-if="isPDFLoad" annotation-layer text-layer
                 :source="pdfSource" @rendering-failed="handleLoadFail"/>
</template>

<script setup lang="ts">
import VuePdfEmbed from 'vue-pdf-embed'
// essential styles
import 'vue-pdf-embed/dist/style/index.css'
// optional styles
import 'vue-pdf-embed/dist/style/annotationLayer.css'
import 'vue-pdf-embed/dist/style/textLayer.css'
import {onMounted, ref} from "vue";
import {ElMessage} from "element-plus";
import {getStudentTalentPlan} from "@/service/student/student.service";

const isPDFLoad = ref(false)
var pdfSource: string
onMounted(() => {
    pdfSource = getStudentTalentPlan()
    isPDFLoad.value = true
})

function handleLoadFail() {
    ElMessage({
        message: "操作有误",
        type: "error",
        duration: 2000
    });
}
</script>

<style scoped>

</style>